/*
 *  Assignment7.cpp
 *  
 *
 *  Created by Mario Serrano on 4/12/13.
 *  Copyright 2013 __MyCompanyName__. All rights reserved.
 *
 */

#include "Assignment7.h"
#include "LinkedList.h"
#include "Queue.h"
#include <iostream>
#include <string>
#include <sstream>

using namespace std;


int main(){
	int graph_size;
	string line;
	string word;
	string curWord;
	
	
	
	int i = 0;
	
	
	cin >> graph_size;
	cout << graph_size << endl;
	//cin.ignore(20,'\n');
	string list[100];
	while(getline(cin, line) && line == ""){};
	
	do{
		std::istringstream word(line);
		
		if (word >> curWord) {
			list[i] = curWord;
			i++;
			while (word >> curWord) {
				list[i] = curWord;
				i++;
			}
			
		}
		
		getline(cin, line);
		
		//list[i] = word;
		i++;
		//cout << line;
		//cin.get(input);
		
		//cout << ".";
		//cin.ignore();
		
	}while (line != "");
	
	for (i = 0; i <= 100; i++) {
		cout << list[i] << endl;
	}
	
	
	return 0;
	

}


